package com.Service;

import com.dao.ClassMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.entity.Class;
import java.util.List;

@Service
public class ClassService {
    @Autowired
    private ClassMapper classMapper;

    /**
     * 查询
     * @param cla
     * @return
     */
    public List<Class> queryClass(Class cla){
        return classMapper.selectAll();
    }

    /**
     * 新增
     * @param cla
     * @return
     */
    public int addClass(Class cla){
        return classMapper.insert(cla);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    public int delClass(int id){
        return classMapper.deleteByPrimaryKey(id);
    }

    /**
     * 修改
     * @param cla
     * @return
     */
    public int updateClass(Class cla){
        return classMapper.updateByPrimaryKey(cla);
    }
}
